﻿using System;
using System.Data.Entity;

namespace DG.Common.EF.Logging
{
    public interface IEFLoggable<TLogId, TLogCampoId, TLogKeyId, TUsuarioID, TLogTipoId>
        where TLogId : struct  , IComparable<TLogId>
        where TLogCampoId : struct  , IComparable<TLogCampoId>
        where TLogKeyId : struct  , IComparable<TLogKeyId>
        where TUsuarioID : struct  , IComparable<TUsuarioID>
        where TLogTipoId : struct  , IComparable
    {
        DbContext Context { get; }

        ILog<TLogId,TLogCampoId, TLogKeyId, TUsuarioID, TLogTipoId> CreateLog();
        ILogCampo<TLogId, TLogCampoId, TLogKeyId, TUsuarioID, TLogTipoId> CreateLogItem();
        ILogKey<TLogId, TLogCampoId, TLogKeyId, TUsuarioID, TLogTipoId> CreateLogKey();
        TLogId GetNextLogID();

        string UsuarioNome { get; }
        TUsuarioID UsuarioID { get; }

        int BaseSaveChanges();

        TLogTipoId AddedId { get; }
        TLogTipoId ModifiedId { get; }
        TLogTipoId DeletedId { get; }
        TLogTipoId ErrorId { get; }
        TLogId GetIncrementId(TLogId id);
    }
}